package com.bailan.foreat.controller;


import com.bailan.foreat.entity.ProductType;
import com.bailan.foreat.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
@RestController
@RequestMapping("/productType")
public class ProductTypeController {

    @Autowired
    private ProductTypeService productTypeService;

    @RequestMapping("all")
    public List<ProductType> all(Integer storeId){
        List<ProductType> productTypeList=productTypeService.queryByStoreId(storeId);
        return productTypeList;
    }

    @RequestMapping("allTypes")
    public List<ProductType> allTypes(){
        List<ProductType> productTypeList=productTypeService.list();
        return productTypeList;
    }

}

